home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1959PO (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.4 KB  |  35 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.AbstractAction;
  4. import java.awt.event.ActionEvent;
  5. import java.io.Serializable;
  6.  
  7. class BasicTreeUI$TreeToggleAction extends AbstractAction implements Serializable {
  8.    // $FF: synthetic field
  9.    BasicTreeUI this$0;
  10.  
  11.    // $FF: synthetic method
  12.    public BasicTreeUI$TreeToggleAction(BasicTreeUI this$0, String name) {
  13.       super(name);
  14.       this.this$0 = this$0;
  15.    }
  16.  
  17.    public void actionPerformed(ActionEvent e) {
  18.       if (this.this$0.tree != null) {
  19.          int selRow = this.this$0.tree.getMinSelectionRow();
  20.          if (selRow != -1 && !this.this$0.isLeaf(selRow)) {
  21.             if (this.this$0.isExpanded(selRow)) {
  22.                this.this$0.collapseRow(selRow);
  23.             } else {
  24.                this.this$0.expandRow(selRow);
  25.             }
  26.          }
  27.       }
  28.  
  29.    }
  30.  
  31.    public boolean isEnabled() {
  32.       return this.this$0.tree != null && this.this$0.tree.isEnabled();
  33.    }
  34. }
  35.